<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/locale/easyui-lang-zh_CN.js"></script>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/gray/easyui.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">

	<link rel="stylesheet" href="__PUBLIC__/js/kindeditor/themes/default/default.css" />
    <script src="__PUBLIC__/js/kindeditor/kindeditor_name.js"></script>
    <script src="__PUBLIC__/js/kindeditor/lang/zh_CN.js"></script>
	<style type="text/css">
		div,span{
			font-size: 14px;
			color: #444444;
		}
		tr td{
			font-size: 12px;
			color: #444444;
		}
		th{
			font-size: 12px;
			color: #444444;
		}
	</style>
	<script type="text/javascript">

		

		$(function(){
			$('#addleavefrm').form({
				url:'__APP__/Process/doApproval',
			    onSubmit:function(){
			        return $(this).form('validate');
			    },
			    success:function(data){
			    	$.messager.alert('提示', data, 'info');
			    }

			});


			//消息催促
			$('#msgUrge').click(function(){
				var msg_to=$("#msg_to").val();
				var msg_title=$("#msg_title").val();
				var msg_content=$("#msg_content").val();
				var process_num=$(".process_num").val();
				$.ajax({
					type:'post',
					url:'__APP__/Message/sendMsgHtml',
					data:{msg_to:msg_to,msg_title:msg_title,msg_content:msg_content,process_num:process_num},
					success:function(data){
						if(data=='ok'){
							$.messager.alert('提示', '发送成功', 'info');
						}
						if(data=='no'){
							$.messager.alert('提示', '发送失败', 'info');
						}
						if(data=='later'){
							$.messager.alert('提示','消息已发送，请在半小时后再发送！','info');
						}
					}
				})
			})

			//短信催促
			$('#msmUrge').click(function(){
				var employe_phone=$("#employe_phone").val();
				var msg_title=$("#msg_title").val();
				var msg_content=$("#msg_content").val();
				var process_num=$(".process_num").val();
				$.ajax({
					type:'post',
					url:'__APP__/Message/sendSMSHtml',
					data:{employe_phone:employe_phone,msg_title:msg_title,msg_content:msg_content,process_num:process_num},
					success:function(data){
						if(data=='later'){
							$.messager.alert('提示','短信已发送，请在半小时后再发送！','info');
						}
						else{
							$.messager.alert('提示',data,'info');
						}
						
					}
				})
			})
		})
		




		KindEditor.ready(function(K) {
			window.editor = K.create('.process_sign_name',{resizeType: 0,allowFileManager: true,allowImageRemote:false,afterBlur: function(){this.sync();}});
		});

	</script>
</head>
<body>
<form id="addleavefrm" method="post">
<volist name="data" id="vo">
<div id="printDiv" style="text-align: center; margin: 0 auto;">
	<div>
		<span id="processInsId" style="float: right;"></span>
		<span id="formTitle" style="font-size: 18px;">请假申请单</span>
	</div>
	<div id="formDiv">
		<table class="editTable" style="width:100%; border-collapse: collapse; line-height:22px; margin-top:3px;">
			<colgroup span="6" width="16%"></colgroup>
		<tbody>
			
			<tr>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">申请人：</td>
				<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
						<input id="employe_name" name="employe_name" type="text" value="{$employeName}" readonly="readonly" /></td>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">流程号：</td>
				<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<volist name="processData" id="voo">
						<input class="process_num" name="process_num" readonly="readonly" value="{$voo.process_num}" /></td>
						<input type="hidden" name="process_now_id" value="{$voo.process_now_id}"/>
						<input type="hidden" name="process_id" value="{$voo.process_id}"/>
						<input type="hidden" name="process_title" value="{$voo.process_title}" />
						<input type="hidden" name="process_begin_id" value="{$voo.process_begin_id}" />
						<input type="hidden" name="process_time" value="{$voo.process_time}" />
						<input type="hidden" name="process_type" value="{$voo.process_type}" />
					</volist>
			</tr>
			<tr>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">职位：</td>
				<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<input id="position" name="leave_position" type="text" value="{$position}" readonly="readonly" />
				</td>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">部门：</td>
				<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<input id="dpt_name" name="dpt_name" type="text" value="{$department}" readonly="readonly" />
				</td>
			</tr>

			<tr>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">开始时间：</td>
				<td style="text-align: left; width:32%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<input id="startTime" class="easyui-datetimebox" name="leave_begin_time" value="{$vo.leave_begin_time}" readonly="readonly"/></td>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">结束时间：</td>
				<td style="text-align: left; width:32%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<input id="endTime" class="easyui-datetimebox" name="leave_end_time" type="text" value="{$vo.leave_end_time}" readonly="readonly"/></td>
			</tr>
			<tr>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">请假天数：</td>
				<td style="text-align: left; width:32%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<input id="dayNumber" name="leave_date_num"  type="text" readonly="readonly" value="{$vo.leave_date_num}" /></td>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">请假类型：</td>
				<td style="text-align: left; width:32%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
					<input type="text" readonly="readonly" value="{$vo.leave_type}">
				</td>
				
			</tr>
			<tr>
				<td style="padding: 3px; border: 1px solid #D3D3D3; text-align: left; width:96%;" colspan="6">
					<div id="attendPrompt"></div>
				</td>
			</tr>
			<tr>
				<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">请假事由：</td>
				<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
					<textarea id="leave_reason" name="leave_reason" style="width:90%;height:40px;" readonly="readonly">{$vo.leave_reason}</textarea>
				</td>
			</tr>	
			
		</tbody>
	</table>
</div>
</div>
<volist name="allApprovalData" id="voo">
<div id="nextStepSet" style="padding-top: 10px;" class="noprint">
	<div class="title">审批记录</div>
	<div id="nextStepCont">
		<table class="editTable" style="width:100%;border: 1px solid #D3D3D3">
			<tbody>
				<tr style="border: 1px solid #D3D3D3;">
					<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批人：</th>
					<td style=" border: 1px solid #D3D3D3;">
							<span style="margin-left: 15px;">
								{$voo.employe_name}
							</span>
							<input type="hidden" id="employe_phone" name="employe_phone" value="{$voo.employe_phone}"/>
					</td>
					<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批意见：</th>
					<td style=" border: 1px solid #D3D3D3;">
							<span style="margin-left: 15px;">
								<eq name="voo.process_approval" value="1">批准</eq>
								<eq name="voo.process_approval" value="0">不予批准</eq>
								<eq name="voo.process_approval" value="">还未审批</eq>
							</span>
							<eq name="detail" value="true">
								<eq name="voo.process_now_id_if_approval" value="0">
									<input type="hidden" id="msg_to" value="{$voo.process_now_id}"/>
									
									<input type="hidden" id="msg_title" value="{$voo.process_title}"/>
									<input type="hidden" id="msg_content" value="您还有未完成的审批，请审批下"/>
									<a href="javascript:void(0);" id="msgUrge" class="easyui-linkbutton">消息催促</a>
									<a href="javascript:void(0);" id="msmUrge" class="easyui-linkbutton">短信催促</a>
								</eq>
							</eq>
					</td>
					
					<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批时间：</th>
					<td style=" border: 1px solid #D3D3D3;">
							<span style="margin-left: 15px;">
								{$voo.process_time|date="Y-m-d H:i:s",###}
							</span>
					</td>
				</tr> 
				<tr>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">备注：</td>
					<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
						<textarea style="width:90%;height:40px;" readonly="readonly">{$voo.process_remark}</textarea>
					</td>
				</tr>
				<tr>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">领导签名：</td>
					<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
						<textarea class="process_sign_name" style="width:90%;height:40px;" readonly="readonly">{$voo.process_sign_name}</textarea>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>

</volist>
</volist>

<neq name="detail" value="true">

<div id="nextStepSet" style="padding-top: 10px;" class="noprint">
	<div class="title">审批</div>

	<div id="nextStepCont">
		<table class="editTable" style="width:100%;border: 1px solid #D3D3D3">
			<tbody>
				<tr style="border: 1px solid #D3D3D3;">
					<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批意见：</th>
					<td style=" border: 1px solid #D3D3D3;">
							<span style="margin-left: 15px;">
								<input name="process_approval" type="radio" value="1" checked="true" />批准</span>
							<span style="margin-left: 15px;">
								<input name="process_approval" type="radio" value="0" />不予批准</span>
					</td>
				</tr> 
				<tr>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">备注：</td>
					<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
						<textarea id="process_remark" name="process_remark" style="width:90%;height:40px;"></textarea>
					</td>
				</tr>
				<tr>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">领导签名：</td>
					<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
						<textarea class="process_sign_name" name="process_sign_name" style="width:90%;height:40px;"></textarea>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>


<neq name="sign" value="over">
<div id="nextStepSet" style="padding-top: 10px;" class="noprint">
	<div class="title">下一步任务设置</div>
	<div id="nextStepCont">
		<table class="editTable" style="width:100%;border: 1px solid #D3D3D3">
			<tbody>
				<tr style="border: 1px solid #D3D3D3;">
					<th style="border: 1px solid #D3D3D3;">任务执行人：</th>
					<td style=" border: 1px solid #D3D3D3;">
						<span id="noper_420">
							<input id="oper_420" value="" type="hidden">
							<input readonly="readonly" id="check_person" class="easyui-validatebox" name="check_person" onclick="doSearch()" type="text" data-options="required:true">
							<input type="hidden" id="check_person_id" name="check_person_id"/>
							<span style="margin-left: 15px;">
								<input id="msg_tip" name="msg_tip" checked="checked" type="checkbox">消息提醒</span>
							<span style="margin-left: 15px;">
								<input id="msg_phone" name="msg_phone" type="checkbox">手机提醒</span>
						</span>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>
<include file="Common:checkPerson"/>
</neq>
<div style="width:100%;text-align: center; margin-top:20px;">
	<input type="submit" value="审批"/>
</div>
</neq>

</form>

</body>
</html>